package com.example.test;

/**
 * @author shanchong
 * @date 2021/4/9
 **/
public class NpeDemo {

    public static void main(String[] args) {
        A a = new A();
        Integer s = a!=null?a.getI():0;
//        Integer integer = Integer.valueOf((a != null) ? a.getI().intValue() : 0);
        System.out.println(s);
    }

    public static class A {

        private Integer i;

        public Integer getI() {
            return i;
        }

        public void setI(final Integer i) {
            this.i = i;
        }
    }

}
